package com.xuecheng.content.convert;


import com.xuecheng.api.content.model.dto.CourseBaseDTO;
import com.xuecheng.api.content.model.vo.CourseAuditVO;
import com.xuecheng.api.content.model.vo.CourseBaseVO;
import com.xuecheng.content.entity.CourseBase;
import com.xuecheng.content.entity.CoursePubDTO;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.factory.Mappers;

import java.util.List;

@Mapper
public interface CourseBaseConvert {
    CourseBaseConvert INSTANCE= Mappers.getMapper(CourseBaseConvert.class);


    @Mapping(source = "id",target ="courseBaseId" )
    CourseBaseDTO entity2dto(CourseBase courseBase);

    List<CourseBaseDTO> entities2dtos(List<CourseBase> courseBaseLists);

    CourseBaseDTO vo2dto(CourseBaseVO courseBaseVO);

    CourseBase dto2vo(CourseBaseDTO courseBaseDTO);


    CourseBaseDTO audit2dto(CourseAuditVO auditVO);

    CoursePub course2coursePub(CourseBaseDTO course);
}
